package com.bougaga.samplespringcloud.rabbitmq.sender;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Sender {

	private  Logger logger = LoggerFactory.getLogger(Sender.class);
	@Autowired
    private AmqpTemplate rabbitTemplate;
    public void send(String msg) {
    	logger.info("sending: "+msg);
        this.rabbitTemplate.convertAndSend("hello", msg);
        
    }
}
